package com.hyperchain.notification;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 根据不同的type获取不同的策略
 */
@Component
public class NotificationFactory {

    @Resource
    private Map<String, NoticeCationBaseStrategy> noticeCationBaseStrategyMap;

    public NoticeCationBaseStrategy getNoticeCationBaseStrategy(NotificationType type){
        return noticeCationBaseStrategyMap.getOrDefault(type.getType(), null);
    }

}
